//
//  UIImage+ZLCategory.h
//  ZLCategory
//
//  Created by zhaozl on 2022/4/26.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIImage (ZLCategory)

/// 创建二维码图片
+ (UIImage *)zl_createQRImageWithContent:(NSString *)content;

/// 创建单色图片
+ (UIImage *)zl_imageWithColor:(UIColor *)color;

/// 基于中心点拉伸图片
- (UIImage *)zl_autoSize;

/// 获取可拉伸图片
/// @param rect 拉伸区域
- (UIImage *)zl_stretchInRect:(CGRect)rect;

/// 拉伸图片
/// @param rect 拉伸区域
/// @param mode 模式
- (UIImage *)zl_stretchInRect:(CGRect)rect mode:(UIImageResizingMode)mode;

/// 设置图片颜色
/// @param color 颜色
- (UIImage *)zl_resetColor:(UIColor *)color;

/// 压缩到指定尺寸
/// @param size 尺寸
- (UIImage *)zl_compressToSize:(CGSize)size;

@end

NS_ASSUME_NONNULL_END
